package fan.project3_pksystem.Module;

import lombok.Data;

@Data
public class Response<T> {
    private ResponseStatus code;
    private T data;
    private String ErrMsg;

    public static<T> Response<T>  success (T data){
        Response<T>  r = new Response<T> ();
        r.setCode(ResponseStatus.SUCCESS);
        r.setData(data);
        return r;
    }

    public static<T> Response<T> fail ( String errMsg){
        Response<T>  r = new Response<T> ();
        r.setCode(ResponseStatus.FAIL);
        r.setErrMsg(errMsg);
        return r;
    }

}
